<?php
/** 
 * ArticleStats extension
 * @author Aude
 * @version 0.1
 */

/**
 * Exit if called outside of MediaWiki
 */
if( !defined( 'MEDIAWIKI' ) ) {
    echo( "This file is an extension to the MediaWiki software and cannot be used standalone.\n" );
    die( 1 );
}

$wgExtensionCredits['specialpage'][] = array(
        'name' => 'Article Stats',
        'author' => 'Aude',
        'url' => 'http://www.mediawiki.org/wiki/Extension:ArticleStats',
        'version' => '1.0',
        'description' => 'Adds article stats special page',
);

$dir = dirname(__FILE__) . '/';

/*
 * Enable JpGraph component
 */
$wgUseJpGraph = true;
$wgJpGraphPath = $dir . 'jpgraph/src/';
$wgJpImgDir = '/wikimaps/extensions/Sandbox/charts/';

if ( ( $wgUseJpGraph ) && ( ! function_exists( 'imagecreate' ) ) ) {
	echo( "The JpGraph component of the Article Stats extension requires the GD library, however the GD library is missing.\n" );
	die( 1 );
}

// Autoload Classes
$wgAutoloadClasses['ArticleStats'] = $dir . 'ArticleStats.class.php';
$wgAutoloadClasses['WikiContribsChart'] = $dir . 'WikiContribsChart.php';

// Messages
$wgExtensionMessagesFiles['ArticleStats'] = $dir . 'ArticleStats.i18n.php';
$wgExtensionAliasesFiles['ArticleStats'] = $dir . 'ArticleStats.alias.php';

$wgSpecialPages['ArticleStats'] = 'ArticleStats';
$wgSpecialPageGroups['ArticleStats'] = 'other';


